package models

import "gorm.io/gorm"

type AuthRelName struct {
	gorm.Model
	UserId   int64  `gorm:"type:int;not null;commit:'用户Id'"`
	IdCard   string `gorm:"type:char(18);unique;not null;commit:'身份证'"`
	RealName string `gorm:"type:varchar(60);not null;commit:'真实姓名'"`
}

func (u *AuthRelName) AuthList() error {
	return DB.Where("id=?", u.ID).Limit(1).Find(&u).Error
}
func (u *AuthRelName) AuthAdd() error {
	return DB.Create(&u).Error
}
